// 该文件专门用于创建整个应用的路由器
import VueRouter from 'vue-router'
//引入组件
import About from '../views/About'
import Home from '../views/Home'
import Message from '../views/Message'
import News from '../views/News'
import Detail from '../views/Detail'


//创建并暴露一个路由器
export default new VueRouter({
	routes:[
		{
			path: '/about',
			component: About
		},
		{
			path: '/home',
			component: Home,
			children: [
				{
					path:'message',
					component: Message,
					children: [
						{
							name:'detail',
							path:'detail/:id/:title', // 使用占位符声明接收params参数
							component: Detail,
						}
					]
				},
				{
					path:'news',
					component: News
				}
			]
		}
	]
})
